<!--<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="box"></div>
		<input type="text" name="" id="put" value="" />
		<button onclick="inserttest()">插入内容</button>
		<script type="text/javascript">
			function inserttest(){
				var box=document.getElementById("box");
				var input=document.getElementById("put");
				box.innerHTML="盒子内容";
				box.value=input.value;
			}
			
			
		</script>
	</body>
</html>-->


<!DOCTYPE html>
<html>
<head>
  <title>Insert Content</title>
  		<meta charset="UTF-8">
</head>
<body>
  <div id="myBox"></div>
  <input type="text" id="myInput">
  <button onclick="insertContent()">插入内容</button>

  <script>
    function insertContent() {
      var box = document.getElementById("myBox");
      var input = document.getElementById("myInput");
      
      // 向盒子中插入内容
      box.innerHTML = input.value;
      
      // 将文本框的值设置为输入的内容
      box.value ="" ;
    }
  </script>
</body>
</html>

